package com.zjcode.cdcer.mapper;

import com.chinatechstar.component.commons.supports.PageData;
import com.zjcode.cdcer.model.PushDataInfo;
import com.zjcode.cdcer.model.TkmSysteminitImportInfo;
import com.zjcode.cdcer.pojo.CerSysteminitImportInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

@Mapper
public interface CerSysteminitImportInfoMapper {

    List<LinkedHashMap<String, Object>> listAllTableData(@Param("pageData") PageData pageData);

    void batchDeletion(@Param("pageData") PageData pageData);

    void oneClickDelete(@Param("pageData") PageData pageData);

    List<CerSysteminitImportInfo> getAllNoErrorData(@Param("pageData") PageData pageData);

    Integer updateCerSysteminitImportInfoStatus(@Param("pageData") PageData pageData);
    Integer returnCerSysteminitImportInfoStatus(@Param("pageData") PageData pageData);

    List<LinkedHashMap<String, Object>> selectAllByExtFlagAndIdList(@Param("extFlag") String extFlag,
                                                                    @Param("idCollection") Collection<String> idCollection);

    List<CerSysteminitImportInfo> queryAllData();

    int countInitData(Date time);

    int countInitDataT2(@Param("time") Date time, @Param("cityid") String cityid);

    List<CerSysteminitImportInfo> queryByAll(CerSysteminitImportInfo cerSysteminitImportInfo);

    int deleteByIdIn(@Param("idCollection") Collection<String> idCollection);

    Integer countByInsertDatetimeBetweenEqual(@Param("minInsertDatetime") Date minInsertDatetime,
                                              @Param("maxInsertDatetime") Date maxInsertDatetime);


    CerSysteminitImportInfo selInfoById(@Param("id") String id);

    List<LinkedHashMap<String, Object>> newQueryAllExportData(@Param("extFlag") String extFlag, @Param("idsData") Object idsData, @Param("ids") List<String> ids,
                                                              @Param("pageData") PageData pageData);

    List<LinkedHashMap<String, Object>> selNjNumByOrgId(@Param("orgIdList") List<Long> orgIdList, @Param("screeningType") Integer screeningType, @Param("pageData") PageData pageData);

    List<LinkedHashMap<String, Object>> selZzNumByOrgId(@Param("orgIdList") List<Long> orgIdList, @Param("screeningType") Integer screeningType, @Param("pageData") PageData pageData);

    List<LinkedHashMap<String, Object>> selBbNumByOrgId(@Param("orgIdList") List<Long> orgIdList, @Param("screeningType") Integer screeningType, @Param("pageData") PageData pageData);

    int del(@Param("id") String id);

    List<String> selByNameAndNjzlTime(@Param("name") String name, @Param("numOrTime") String numOrTime, @Param("idList") List<String> idList);

    void updateNjReport(@Param("filePath") String filePath, @Param("fileUrl") String fileUrl, @Param("ids") List<String> ids);

    List<String> selByNameAndBlTime(@Param("name") String name, @Param("numOrTime") String numOrTime, @Param("idList") List<String> idList);

    void updateBlReport(@Param("filePath") String filePath, @Param("fileUrl") String fileUrl, @Param("ids") List<String> ids);

    int addBatchInitImport(@Param("list") List<TkmSysteminitImportInfo> tkmSysteminitImportInfos);

    List<CerSysteminitImportInfo> getAllInitImports();

    List<CerSysteminitImportInfo> getAllInitImportsByScreeningIds(@Param("screeningIdsByImport") List<String> screeningIdsByImport);

    int updateBatchStatusByIds(@Param("initIds") List<String> initIds, @Param("delStatus") int delStatus);

    Integer selNeigongNum(@Param("year") String year);

    Integer selPositiveNum(@Param("hp") String hp, @Param("year") String year);

    Integer selZzNum(@Param("year") String year);

    List<LinkedHashMap<String, Object>> selDataNumByOrgId(@Param("orgIdList") List<Long> orgIdList, @Param("pageData") PageData pageData);

    Integer selBbNum(@Param("year") String year);

    String selRiskReportIdById(@Param("id") String id);

    String selOrgId();

    List<PushDataInfo> getPushNationList(@Param("idList") List<String> idList);

    void updateUploadBatchInfo(@Param("id") String id);

    /**
     *  推送国家平台后状态更新
     * @param id
     */
    void updateCrowdStatus(@Param("id") String id);
}
